<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <el-form-item label="采购单号" prop="purchaseOrderNumber">
        <el-input
          v-model="queryParams.purchaseOrderNumber"
          placeholder="请输入采购单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="采购单备注" prop="purchaseOrderRemark">
        <el-input
          v-model="queryParams.purchaseOrderRemark"
          placeholder="采购单备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="采购日期" prop="purchaseDate">
        <el-date-picker
          clearable
          v-model="queryParams.purchaseDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择采购日期"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
        <el-button
          :icon="!isOpen ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
          size="mini"
          @click="shouqi"
          >展开/收起</el-button
        >
      </el-form-item>
      <div v-if="isOpen">
        <el-form-item label="供应商分类" prop="supplierClassification">
          <el-input
            v-model="queryParams.supplierClassification"
            placeholder="选择供应商分类"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="多标签|标记" prop="tags">
          <el-input
            v-model="queryParams.tags"
            placeholder="请输入多标签|标记"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="税率" prop="taxRate">
          <el-input
            v-model="queryParams.taxRate"
            placeholder="请输入税率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="总金额" prop="totalAmount">
          <el-input
            v-model="queryParams.totalAmount"
            placeholder="请输入总金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="溢装比例" prop="overflowRatio">
          <el-input
            v-model="queryParams.overflowRatio"
            placeholder="请输入溢装比例"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="采购员" prop="purchaser">
          <el-input
            v-model="queryParams.purchaser"
            placeholder="请输入采购员"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="收货地址" prop="receiptAddress">
          <el-input
            v-model="queryParams.receiptAddress"
            placeholder="请输入收货地址"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="付款方式" prop="paymentMethod">
          <el-input
            v-model="queryParams.paymentMethod"
            placeholder="请输入付款方式"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="线上采购单号" prop="onlinePurchaseOrderNumber">
          <el-input
            v-model="queryParams.onlinePurchaseOrderNumber"
            placeholder="请输入线上采购单号"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="账期天数" prop="paymentTermDays">
          <el-input
            v-model="queryParams.paymentTermDays"
            placeholder="请输入账期天数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="外部订单号" prop="externalOrderNumber">
          <el-input
            v-model="queryParams.externalOrderNumber"
            placeholder="请输入外部订单号"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="仓储方" prop="storageParty">
          <el-input
            v-model="queryParams.storageParty"
            placeholder="请输入仓储方"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="审核人" prop="reviewer">
          <el-input
            v-model="queryParams.reviewer"
            placeholder="请输入审核人"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="审核日期" prop="reviewDate">
          <el-date-picker
            clearable
            v-model="queryParams.reviewDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择审核日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="虚拟仓" prop="virtualWarehouse">
          <el-input
            v-model="queryParams.virtualWarehouse"
            placeholder="请输入虚拟仓"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="物流公司" prop="logisticsCompany">
          <el-input
            v-model="queryParams.logisticsCompany"
            placeholder="请输入物流公司"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="物流单号" prop="logisticsNumber">
          <el-input
            v-model="queryParams.logisticsNumber"
            placeholder="请输入物流单号"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="运费" prop="freightCost">
          <el-input
            v-model="queryParams.freightCost"
            placeholder="请输入运费"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="预付款金额" prop="prepaymentAmount">
          <el-input
            v-model="queryParams.prepaymentAmount"
            placeholder="请输入预付款金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="完成日期" prop="completionDate">
          <el-date-picker
            clearable
            v-model="queryParams.completionDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择完成日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="图片" prop="imageUrl">
          <el-input
            v-model="queryParams.imageUrl"
            placeholder="请输入图片"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="商品编码" prop="productCode">
          <el-input
            v-model="queryParams.productCode"
            placeholder="请输入商品编码"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="商品标签" prop="productTags">
          <el-input
            v-model="queryParams.productTags"
            placeholder="请输入商品标签"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="国标码" prop="nationalStandardCode">
          <el-input
            v-model="queryParams.nationalStandardCode"
            placeholder="请输入国标码"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="商品名称" prop="productName">
          <el-input
            v-model="queryParams.productName"
            placeholder="请输入商品名称"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="颜色及规格" prop="colorAndSpecification">
          <el-input
            v-model="queryParams.colorAndSpecification"
            placeholder="请输入颜色及规格"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="数量" prop="quantity">
          <el-input
            v-model="queryParams.quantity"
            placeholder="请输入数量"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="标准装箱数量" prop="standardPackingQuantity">
          <el-input
            v-model="queryParams.standardPackingQuantity"
            placeholder="请输入标准装箱数量"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="箱数" prop="boxCount">
          <el-input
            v-model="queryParams.boxCount"
            placeholder="请输入箱数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="供应商发货数" prop="supplierShipmentQuantity">
          <el-input
            v-model="queryParams.supplierShipmentQuantity"
            placeholder="选择供应商发货数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="初始采购数" prop="initialPurchaseQuantity">
          <el-input
            v-model="queryParams.initialPurchaseQuantity"
            placeholder="请输入初始采购数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="已入库数量" prop="receivedQuantity">
          <el-input
            v-model="queryParams.receivedQuantity"
            placeholder="请输入已入库数量"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="差异数" prop="differenceQuantity">
          <el-input
            v-model="queryParams.differenceQuantity"
            placeholder="请输入差异数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="发货入库差异" prop="shipmentReceiptDifference">
          <el-input
            v-model="queryParams.shipmentReceiptDifference"
            placeholder="请输入发货入库差异"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="重量" prop="weight">
          <el-input
            v-model="queryParams.weight"
            placeholder="请输入重量"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="总可用数" prop="totalAvailableQuantity">
          <el-input
            v-model="queryParams.totalAvailableQuantity"
            placeholder="请输入总可用数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="已入库金额" prop="receivedAmount">
          <el-input
            v-model="queryParams.receivedAmount"
            placeholder="请输入已入库金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="单价参考值" prop="unitPriceReference">
          <el-input
            v-model="queryParams.unitPriceReference"
            placeholder="请输入单价参考值"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="单价" prop="unitPrice">
          <el-input
            v-model="queryParams.unitPrice"
            placeholder="请输入单价"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="金额" prop="amount">
          <el-input
            v-model="queryParams.amount"
            placeholder="请输入金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="不含税单价" prop="taxExcludedUnitPrice">
          <el-input
            v-model="queryParams.taxExcludedUnitPrice"
            placeholder="请输入不含税单价"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="不含税金额" prop="taxExcludedAmount">
          <el-input
            v-model="queryParams.taxExcludedAmount"
            placeholder="请输入不含税金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="款式编码" prop="styleCode">
          <el-input
            v-model="queryParams.styleCode"
            placeholder="请输入款式编码"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="供应商款号" prop="supplierStyleNumber">
          <el-input
            v-model="queryParams.supplierStyleNumber"
            placeholder="选择供应商款号"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="供应商商品编码" prop="supplierProductCode">
          <el-input
            v-model="queryParams.supplierProductCode"
            placeholder="选择供应商商品编码"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="预计到货数量" prop="expectedArrivalQuantity">
          <el-input
            v-model="queryParams.expectedArrivalQuantity"
            placeholder="请输入预计到货数量"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="预计到货金额" prop="expectedArrivalAmount">
          <el-input
            v-model="queryParams.expectedArrivalAmount"
            placeholder="请输入预计到货金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="装箱编号" prop="packingNumber">
          <el-input
            v-model="queryParams.packingNumber"
            placeholder="请输入装箱编号"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="协议到货日期" prop="agreedArrivalDate">
          <el-date-picker
            clearable
            v-model="queryParams.agreedArrivalDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择协议到货日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="默认仓位" prop="defaultStorageLocation">
          <el-input
            v-model="queryParams.defaultStorageLocation"
            placeholder="请输入默认仓位"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="来源单号" prop="sourceOrderNumber">
          <el-input
            v-model="queryParams.sourceOrderNumber"
            placeholder="请输入来源单号"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="明细税率" prop="detailTaxRate">
          <el-input
            v-model="queryParams.detailTaxRate"
            placeholder="请输入明细税率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="明细单号" prop="detailOrderNumber">
          <el-input
            v-model="queryParams.detailOrderNumber"
            placeholder="请输入明细单号"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
      </div>
      <!-- <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
      </el-form-item> -->
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['purchase:PurchaseOrder:add']"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['purchase:PurchaseOrder:edit']"
          >修改</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['purchase:PurchaseOrder:remove']"
          >删除</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['purchase:PurchaseOrder:export']"
          >导出</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-upload
          ref="daoru"
          :action="Upload.url"
          :headers="Upload.headers"
          :limit="limit"
          :on-exceed="handleExceed"
          :on-success="handlePictureSuccessPic"
          :before-upload="beforeAvatarUpload"
          :on-preview="handlePictureCardPreview"
          :file-list="fileLi"
          :on-change="changeFile1"
        >
          <el-button size="mini">导入文件</el-button>
          <!-- <i class="el-icon-plus"></i> -->
        </el-upload>
        <!-- <el-button size="mini" plain icon="el-icon-upload" @click="daoru"
          >导入</el-button
        > -->
      </el-col>
      <el-col :span="1.5">
        <el-button size="mini" @click="handleRuleTagger">打标</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button size="mini" @click="handleGo('/biTool/biruletag')"
          >配置规则</el-button
        >
      </el-col>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>

    <el-table
      v-loading="loading"
      :data="PurchaseOrderList"
      @selection-change="handleSelectionChange"
      :height="650"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column width="130" label="id" align="center" prop="id" />
      <el-table-column
        width="130"
        label="采购单号"
        align="center"
        prop="purchaseOrderNumber"
      />
      <el-table-column
        width="130"
        label="采购日期"
        align="center"
        prop="purchaseDate"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.purchaseDate, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        width="130"
        label="供应商分类"
        align="center"
        prop="supplierClassification"
      />
      <el-table-column
        width="130"
        label="类型"
        align="center"
        prop="contractType"
      />
      <el-table-column width="130" label="状态" align="center" prop="status" />
      <el-table-column
        width="130"
        label="多标签|标记"
        align="center"
        prop="tags"
      />
      <el-table-column
        width="130"
        label="供应商状态"
        align="center"
        prop="supplierStatus"
      />
      <el-table-column
        width="130"
        label="收货状态"
        align="center"
        prop="receiptStatus"
      />
      <el-table-column width="130" label="税率" align="center" prop="taxRate" />
      <el-table-column
        width="130"
        label="总金额"
        align="center"
        prop="totalAmount"
      />
      <el-table-column
        width="130"
        label="溢装比例"
        align="center"
        prop="overflowRatio"
      />
      <el-table-column
        width="130"
        label="采购员"
        align="center"
        prop="purchaser"
      />
      <el-table-column
        width="130"
        label="采购单备注"
        align="center"
        prop="purchaseOrderRemark"
      >
        <template slot-scope="scope">
          <el-popover trigger="hover" placement="bottom" width="300">
            <!-- <span>{{ scope.row.fabricComposition }}</span> -->
            <el-input
              v-model="scope.row.purchaseOrderRemark"
              :min-height="192"
              type="textarea"
              :autosize="{ minRows: 2, maxRows: 24 }"
              :style="{ width: '100%' }"
              :disabled="true"
            />
            <div slot="reference">
              <span class="textname">
                {{ scope.row.purchaseOrderRemark }}
              </span>
            </div>
          </el-popover>
        </template>
      </el-table-column>
      <el-table-column
        width="130"
        label="收货地址"
        align="center"
        prop="receiptAddress"
      >
        <template slot-scope="scope">
          <el-popover trigger="hover" placement="bottom" width="300">
            <!-- <span>{{ scope.row.fabricComposition }}</span> -->
            <el-input
              v-model="scope.row.receiptAddress"
              :min-height="192"
              type="textarea"
              :autosize="{ minRows: 2, maxRows: 24 }"
              :style="{ width: '100%' }"
              :disabled="true"
            />
            <div slot="reference">
              <span class="textname">
                {{ scope.row.receiptAddress }}
              </span>
            </div>
          </el-popover>
        </template>
      </el-table-column>
      <el-table-column
        width="130"
        label="合同条款"
        align="center"
        prop="contractTerms"
      />
      <el-table-column
        width="130"
        label="付款方式"
        align="center"
        prop="paymentMethod"
      />
      <el-table-column
        width="130"
        label="线上采购单号"
        align="center"
        prop="onlinePurchaseOrderNumber"
      />
      <el-table-column
        width="130"
        label="账期天数"
        align="center"
        prop="paymentTermDays"
      />
      <el-table-column
        width="130"
        label="外部订单号"
        align="center"
        prop="externalOrderNumber"
      />
      <el-table-column
        width="130"
        label="采购单类型"
        align="center"
        prop="purchaseOrderType"
      />
      <el-table-column
        width="130"
        label="仓储方"
        align="center"
        prop="storageParty"
      />
      <el-table-column
        width="130"
        label="审核人"
        align="center"
        prop="reviewer"
      />
      <el-table-column
        width="130"
        label="审核日期"
        align="center"
        prop="reviewDate"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.reviewDate, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        width="130"
        label="虚拟仓"
        align="center"
        prop="virtualWarehouse"
      />
      <el-table-column
        width="130"
        label="物流公司"
        align="center"
        prop="logisticsCompany"
      />
      <el-table-column
        width="130"
        label="物流单号"
        align="center"
        prop="logisticsNumber"
      />
      <el-table-column
        width="130"
        label="运费"
        align="center"
        prop="freightCost"
      />
      <el-table-column
        width="130"
        label="预付款金额"
        align="center"
        prop="prepaymentAmount"
      />
      <el-table-column
        width="130"
        label="完成日期"
        align="center"
        prop="completionDate"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.completionDate, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column width="130" label="图片" align="center" prop="imageUrl">
        <template slot-scope="scope">
          <image-preview-full
            :src="scope.row.imageUrl"
            :width="30"
            :height="30"
          />
        </template>
      </el-table-column>
      <el-table-column
        width="130"
        label="商品编码"
        align="center"
        prop="productCode"
      />
      <el-table-column
        width="130"
        label="商品标签"
        align="center"
        prop="productTags"
      />
      <el-table-column
        width="130"
        label="国标码"
        align="center"
        prop="nationalStandardCode"
      />
      <el-table-column
        width="130"
        label="商品名称"
        align="center"
        prop="productName"
      />
      <el-table-column
        width="130"
        label="颜色及规格"
        align="center"
        prop="colorAndSpecification"
      />
      <el-table-column
        width="130"
        label="数量"
        align="center"
        prop="quantity"
      />
      <el-table-column
        width="130"
        label="标准装箱数量"
        align="center"
        prop="standardPackingQuantity"
      />
      <el-table-column
        width="130"
        label="箱数"
        align="center"
        prop="boxCount"
      />
      <el-table-column
        width="130"
        label="供应商发货数"
        align="center"
        prop="supplierShipmentQuantity"
      />
      <el-table-column
        width="130"
        label="初始采购数"
        align="center"
        prop="initialPurchaseQuantity"
      />
      <el-table-column
        width="130"
        label="已入库数量"
        align="center"
        prop="receivedQuantity"
      />
      <el-table-column
        width="130"
        label="差异数"
        align="center"
        prop="differenceQuantity"
      />
      <el-table-column
        width="130"
        label="发货入库差异"
        align="center"
        prop="shipmentReceiptDifference"
      />
      <el-table-column width="130" label="重量" align="center" prop="weight" />
      <el-table-column
        width="130"
        label="总可用数"
        align="center"
        prop="totalAvailableQuantity"
      />
      <el-table-column
        width="130"
        label="已入库金额"
        align="center"
        prop="receivedAmount"
      />
      <el-table-column
        width="130"
        label="单价参考值"
        align="center"
        prop="unitPriceReference"
      />
      <el-table-column
        width="130"
        label="明细备注"
        align="center"
        prop="detailRemark"
      />
      <el-table-column
        width="130"
        label="单价"
        align="center"
        prop="unitPrice"
      />
      <el-table-column width="130" label="金额" align="center" prop="amount" />
      <el-table-column
        width="130"
        label="不含税单价"
        align="center"
        prop="taxExcludedUnitPrice"
      />
      <el-table-column
        width="130"
        label="不含税金额"
        align="center"
        prop="taxExcludedAmount"
      />
      <el-table-column
        width="130"
        label="款式编码"
        align="center"
        prop="styleCode"
      />
      <el-table-column
        width="130"
        label="供应商款号"
        align="center"
        prop="supplierStyleNumber"
      />
      <el-table-column
        width="130"
        label="供应商商品编码"
        align="center"
        prop="supplierProductCode"
      />
      <el-table-column
        width="130"
        label="预计到货数量"
        align="center"
        prop="expectedArrivalQuantity"
      />
      <el-table-column
        width="130"
        label="预计到货金额"
        align="center"
        prop="expectedArrivalAmount"
      />
      <el-table-column
        width="130"
        label="装箱编号"
        align="center"
        prop="packingNumber"
      />
      <el-table-column
        width="130"
        label="协议到货日期"
        align="center"
        prop="agreedArrivalDate"
      >
        <template slot-scope="scope">
          <span>{{
            parseTime(scope.row.agreedArrivalDate, "{y}-{m}-{d}")
          }}</span>
        </template>
      </el-table-column>
      <el-table-column
        width="130"
        label="默认仓位"
        align="center"
        prop="defaultStorageLocation"
      />
      <el-table-column
        width="130"
        label="来源单号"
        align="center"
        prop="sourceOrderNumber"
      />
      <el-table-column
        width="130"
        label="明细税率"
        align="center"
        prop="detailTaxRate"
      />
      <el-table-column
        width="130"
        label="明细单号"
        align="center"
        prop="detailOrderNumber"
      />
      <el-table-column
        width="130"
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['purchase:PurchaseOrder:edit']"
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['purchase:PurchaseOrder:remove']"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改采购单对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="采购单号" prop="purchaseOrderNumber">
          <el-input
            v-model="form.purchaseOrderNumber"
            placeholder="请输入采购单号"
          />
        </el-form-item>
        <el-form-item label="采购日期" prop="purchaseDate">
          <el-date-picker
            clearable
            v-model="form.purchaseDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择采购日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="供应商分类" prop="supplierClassification">
          <el-input
            v-model="form.supplierClassification"
            placeholder="选择供应商分类"
          />
        </el-form-item>
        <el-form-item label="多标签|标记" prop="tags">
          <el-input v-model="form.tags" placeholder="请输入多标签|标记" />
        </el-form-item>
        <el-form-item label="税率" prop="taxRate">
          <el-input v-model="form.taxRate" placeholder="请输入税率" />
        </el-form-item>
        <el-form-item label="总金额" prop="totalAmount">
          <el-input v-model="form.totalAmount" placeholder="请输入总金额" />
        </el-form-item>
        <el-form-item label="溢装比例" prop="overflowRatio">
          <el-input v-model="form.overflowRatio" placeholder="请输入溢装比例" />
        </el-form-item>
        <el-form-item label="采购员" prop="purchaser">
          <el-input v-model="form.purchaser" placeholder="请输入采购员" />
        </el-form-item>
        <el-form-item label="采购单备注" prop="purchaseOrderRemark">
          <el-input
            v-model="form.purchaseOrderRemark"
            type="textarea"
            placeholder="请输入内容"
          />
        </el-form-item>
        <el-form-item label="收货地址" prop="receiptAddress">
          <el-input
            v-model="form.receiptAddress"
            placeholder="请输入收货地址"
          />
        </el-form-item>
        <el-form-item label="合同条款" prop="contractTerms">
          <el-input
            v-model="form.contractTerms"
            type="textarea"
            placeholder="请输入内容"
          />
        </el-form-item>
        <el-form-item label="付款方式" prop="paymentMethod">
          <el-input v-model="form.paymentMethod" placeholder="请输入付款方式" />
        </el-form-item>
        <el-form-item label="线上采购单号" prop="onlinePurchaseOrderNumber">
          <el-input
            v-model="form.onlinePurchaseOrderNumber"
            placeholder="请输入线上采购单号"
          />
        </el-form-item>
        <el-form-item label="账期天数" prop="paymentTermDays">
          <el-input
            v-model="form.paymentTermDays"
            placeholder="请输入账期天数"
          />
        </el-form-item>
        <el-form-item label="外部订单号" prop="externalOrderNumber">
          <el-input
            v-model="form.externalOrderNumber"
            placeholder="请输入外部订单号"
          />
        </el-form-item>
        <el-form-item label="仓储方" prop="storageParty">
          <el-input v-model="form.storageParty" placeholder="请输入仓储方" />
        </el-form-item>
        <el-form-item label="审核人" prop="reviewer">
          <el-input v-model="form.reviewer" placeholder="请输入审核人" />
        </el-form-item>
        <el-form-item label="审核日期" prop="reviewDate">
          <el-date-picker
            clearable
            v-model="form.reviewDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择审核日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="虚拟仓" prop="virtualWarehouse">
          <el-input
            v-model="form.virtualWarehouse"
            placeholder="请输入虚拟仓"
          />
        </el-form-item>
        <el-form-item label="物流公司" prop="logisticsCompany">
          <el-input
            v-model="form.logisticsCompany"
            placeholder="请输入物流公司"
          />
        </el-form-item>
        <el-form-item label="物流单号" prop="logisticsNumber">
          <el-input
            v-model="form.logisticsNumber"
            placeholder="请输入物流单号"
          />
        </el-form-item>
        <el-form-item label="运费" prop="freightCost">
          <el-input v-model="form.freightCost" placeholder="请输入运费" />
        </el-form-item>
        <el-form-item label="预付款金额" prop="prepaymentAmount">
          <el-input
            v-model="form.prepaymentAmount"
            placeholder="请输入预付款金额"
          />
        </el-form-item>
        <el-form-item label="完成日期" prop="completionDate">
          <el-date-picker
            clearable
            v-model="form.completionDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择完成日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="图片" prop="imageUrl">
          <template slot-scope="scope">
            <image-preview :src="scope.row.imageUrl" :width="50" :height="50" />
          </template>
          <!-- <el-input v-model="form.imageUrl" placeholder="请输入图片" /> -->
        </el-form-item>
        <el-form-item label="商品编码" prop="productCode">
          <el-input v-model="form.productCode" placeholder="请输入商品编码" />
        </el-form-item>
        <el-form-item label="商品标签" prop="productTags">
          <el-input v-model="form.productTags" placeholder="请输入商品标签" />
        </el-form-item>
        <el-form-item label="国标码" prop="nationalStandardCode">
          <el-input
            v-model="form.nationalStandardCode"
            placeholder="请输入国标码"
          />
        </el-form-item>
        <el-form-item label="商品名称" prop="productName">
          <el-input v-model="form.productName" placeholder="请输入商品名称" />
        </el-form-item>
        <el-form-item label="颜色及规格" prop="colorAndSpecification">
          <el-input
            v-model="form.colorAndSpecification"
            placeholder="请输入颜色及规格"
          />
        </el-form-item>
        <el-form-item label="数量" prop="quantity">
          <el-input v-model="form.quantity" placeholder="请输入数量" />
        </el-form-item>
        <el-form-item label="标准装箱数量" prop="standardPackingQuantity">
          <el-input
            v-model="form.standardPackingQuantity"
            placeholder="请输入标准装箱数量"
          />
        </el-form-item>
        <el-form-item label="箱数" prop="boxCount">
          <el-input v-model="form.boxCount" placeholder="请输入箱数" />
        </el-form-item>
        <el-form-item label="供应商发货数" prop="supplierShipmentQuantity">
          <el-input
            v-model="form.supplierShipmentQuantity"
            placeholder="选择供应商发货数"
          />
        </el-form-item>
        <el-form-item label="初始采购数" prop="initialPurchaseQuantity">
          <el-input
            v-model="form.initialPurchaseQuantity"
            placeholder="请输入初始采购数"
          />
        </el-form-item>
        <el-form-item label="已入库数量" prop="receivedQuantity">
          <el-input
            v-model="form.receivedQuantity"
            placeholder="请输入已入库数量"
          />
        </el-form-item>
        <el-form-item label="差异数" prop="differenceQuantity">
          <el-input
            v-model="form.differenceQuantity"
            placeholder="请输入差异数"
          />
        </el-form-item>
        <el-form-item label="发货入库差异" prop="shipmentReceiptDifference">
          <el-input
            v-model="form.shipmentReceiptDifference"
            placeholder="请输入发货入库差异"
          />
        </el-form-item>
        <el-form-item label="重量" prop="weight">
          <el-input v-model="form.weight" placeholder="请输入重量" />
        </el-form-item>
        <el-form-item label="总可用数" prop="totalAvailableQuantity">
          <el-input
            v-model="form.totalAvailableQuantity"
            placeholder="请输入总可用数"
          />
        </el-form-item>
        <el-form-item label="已入库金额" prop="receivedAmount">
          <el-input
            v-model="form.receivedAmount"
            placeholder="请输入已入库金额"
          />
        </el-form-item>
        <el-form-item label="单价参考值" prop="unitPriceReference">
          <el-input
            v-model="form.unitPriceReference"
            placeholder="请输入单价参考值"
          />
        </el-form-item>
        <el-form-item label="明细备注" prop="detailRemark">
          <el-input
            v-model="form.detailRemark"
            type="textarea"
            placeholder="请输入内容"
          />
        </el-form-item>
        <el-form-item label="单价" prop="unitPrice">
          <el-input v-model="form.unitPrice" placeholder="请输入单价" />
        </el-form-item>
        <el-form-item label="金额" prop="amount">
          <el-input v-model="form.amount" placeholder="请输入金额" />
        </el-form-item>
        <el-form-item label="不含税单价" prop="taxExcludedUnitPrice">
          <el-input
            v-model="form.taxExcludedUnitPrice"
            placeholder="请输入不含税单价"
          />
        </el-form-item>
        <el-form-item label="不含税金额" prop="taxExcludedAmount">
          <el-input
            v-model="form.taxExcludedAmount"
            placeholder="请输入不含税金额"
          />
        </el-form-item>
        <el-form-item label="款式编码" prop="styleCode">
          <el-input v-model="form.styleCode" placeholder="请输入款式编码" />
        </el-form-item>
        <el-form-item label="供应商款号" prop="supplierStyleNumber">
          <el-input
            v-model="form.supplierStyleNumber"
            placeholder="选择供应商款号"
          />
        </el-form-item>
        <el-form-item label="供应商商品编码" prop="supplierProductCode">
          <el-input
            v-model="form.supplierProductCode"
            placeholder="选择供应商商品编码"
          />
        </el-form-item>
        <el-form-item label="预计到货数量" prop="expectedArrivalQuantity">
          <el-input
            v-model="form.expectedArrivalQuantity"
            placeholder="请输入预计到货数量"
          />
        </el-form-item>
        <el-form-item label="预计到货金额" prop="expectedArrivalAmount">
          <el-input
            v-model="form.expectedArrivalAmount"
            placeholder="请输入预计到货金额"
          />
        </el-form-item>
        <el-form-item label="装箱编号" prop="packingNumber">
          <el-input v-model="form.packingNumber" placeholder="请输入装箱编号" />
        </el-form-item>
        <el-form-item label="协议到货日期" prop="agreedArrivalDate">
          <el-date-picker
            clearable
            v-model="form.agreedArrivalDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择协议到货日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="默认仓位" prop="defaultStorageLocation">
          <el-input
            v-model="form.defaultStorageLocation"
            placeholder="请输入默认仓位"
          />
        </el-form-item>
        <el-form-item label="来源单号" prop="sourceOrderNumber">
          <el-input
            v-model="form.sourceOrderNumber"
            placeholder="请输入来源单号"
          />
        </el-form-item>
        <el-form-item label="明细税率" prop="detailTaxRate">
          <el-input v-model="form.detailTaxRate" placeholder="请输入明细税率" />
        </el-form-item>
        <el-form-item label="明细单号" prop="detailOrderNumber">
          <el-input
            v-model="form.detailOrderNumber"
            placeholder="请输入明细单号"
          />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 添加或修改产品二级信息对话框 :on-change="handleChange"-->
    <el-dialog
      :title="title"
      :visible.sync="dialogVisible"
      width="500px"
      append-to-body
      v-if="dialogVisible"
    >
      <el-upload
        :action="Upload.url"
        :headers="Upload.headers"
        :limit="limit"
        :on-exceed="handleExceed"
        :on-success="handlePictureSuccessPic"
        :before-upload="beforeAvatarUpload"
        :on-preview="handlePictureCardPreview"
        :file-list="fileLi"
        :on-change="changeFile1"
      >
        <el-button size="small" type="primary">导入文件</el-button>
        <!-- <i class="el-icon-plus"></i> -->
      </el-upload>
    </el-dialog>
  </div>
</template>

<script>
import {
  listBiRuleSpecifications,
  getBiRuleSpecifications,
  delBiRuleSpecifications,
  addBiRuleSpecifications,
  updateBiRuleSpecifications,
  RuleTagger,
  getTablefieldsWithComments,
} from "@/api/conf/BiRuleSpecifications";
import {
  listPurchaseOrder,
  getPurchaseOrder,
  delPurchaseOrder,
  addPurchaseOrder,
  updatePurchaseOrder,
} from "@/api/purchase/PurchaseOrder";
//--------导入token
import { getToken } from "@/utils/auth";
export default {
  name: "PurchaseOrder",
  data() {
    return {
      pjtUrl: process.env.VUE_APP_BASE_API,

      fileLi: [],
      file: "",
      dialogVisible: false,
      // 图片数量限制
      limit: 2,
      Upload: {
        // 设置上传的请求头部
        headers: {
          Authorization: "Bearer " + getToken(),
        },
        // 图片上传的方法地址:
        url:
          process.env.VUE_APP_BASE_API + "/purchase/PurchaseOrder/importData",
      },
      isOpen: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 采购单表格数据
      PurchaseOrderList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        purchaseOrderNumber: null,
        purchaseDate: null,
        supplierClassification: null,
        status: null,
        tags: null,
        supplierStatus: null,
        receiptStatus: null,
        taxRate: null,
        totalAmount: null,
        overflowRatio: null,
        purchaser: null,
        purchaseOrderRemark: null,
        receiptAddress: null,
        contractTerms: null,
        paymentMethod: null,
        onlinePurchaseOrderNumber: null,
        paymentTermDays: null,
        externalOrderNumber: null,
        purchaseOrderType: null,
        storageParty: null,
        reviewer: null,
        reviewDate: null,
        virtualWarehouse: null,
        logisticsCompany: null,
        logisticsNumber: null,
        freightCost: null,
        prepaymentAmount: null,
        completionDate: null,
        imageUrl: null,
        productCode: null,
        productTags: null,
        nationalStandardCode: null,
        productName: null,
        colorAndSpecification: null,
        quantity: null,
        standardPackingQuantity: null,
        boxCount: null,
        supplierShipmentQuantity: null,
        initialPurchaseQuantity: null,
        receivedQuantity: null,
        differenceQuantity: null,
        shipmentReceiptDifference: null,
        weight: null,
        totalAvailableQuantity: null,
        receivedAmount: null,
        unitPriceReference: null,
        detailRemark: null,
        unitPrice: null,
        amount: null,
        taxExcludedUnitPrice: null,
        taxExcludedAmount: null,
        styleCode: null,
        supplierStyleNumber: null,
        supplierProductCode: null,
        expectedArrivalQuantity: null,
        expectedArrivalAmount: null,
        packingNumber: null,
        agreedArrivalDate: null,
        defaultStorageLocation: null,
        sourceOrderNumber: null,
        detailTaxRate: null,
        detailOrderNumber: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {},
    };
  },
  created() {
    this.getList();
  },
  methods: {
    handleGo(path) {
      this.$router.push({
        path: path,
        query: { tableName: "purchase_order" },
      });
    },
    // 打开加载层
    openLoading() {
      this.$modal.loading("正在同步数据，请稍候！");
    },

    handleRuleTagger() {
      this.openLoading();
      RuleTagger({ tableName: "purchase_order" }).then((response) => {
        this.$modal.closeLoading();
        if (response.code == 200) {
          this.$modal.msgSuccess("打标成功");
          this.getList();
        }
      });
    },
    //搜索栏展示与收起
    shouqi() {
      // console.log(1);
      this.isOpen = !this.isOpen;
    },
    /** 查询采购单列表 */
    getList() {
      this.loading = true;
      listPurchaseOrder(this.queryParams).then((response) => {
        this.PurchaseOrderList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        purchaseOrderNumber: null,
        purchaseDate: null,
        supplierClassification: null,
        status: null,
        tags: null,
        supplierStatus: null,
        receiptStatus: null,
        taxRate: null,
        totalAmount: null,
        overflowRatio: null,
        purchaser: null,
        purchaseOrderRemark: null,
        receiptAddress: null,
        contractTerms: null,
        paymentMethod: null,
        onlinePurchaseOrderNumber: null,
        paymentTermDays: null,
        externalOrderNumber: null,
        purchaseOrderType: null,
        storageParty: null,
        reviewer: null,
        reviewDate: null,
        virtualWarehouse: null,
        logisticsCompany: null,
        logisticsNumber: null,
        freightCost: null,
        prepaymentAmount: null,
        completionDate: null,
        imageUrl: null,
        productCode: null,
        productTags: null,
        nationalStandardCode: null,
        productName: null,
        colorAndSpecification: null,
        quantity: null,
        standardPackingQuantity: null,
        boxCount: null,
        supplierShipmentQuantity: null,
        initialPurchaseQuantity: null,
        receivedQuantity: null,
        differenceQuantity: null,
        shipmentReceiptDifference: null,
        weight: null,
        totalAvailableQuantity: null,
        receivedAmount: null,
        unitPriceReference: null,
        detailRemark: null,
        unitPrice: null,
        amount: null,
        taxExcludedUnitPrice: null,
        taxExcludedAmount: null,
        styleCode: null,
        supplierStyleNumber: null,
        supplierProductCode: null,
        expectedArrivalQuantity: null,
        expectedArrivalAmount: null,
        packingNumber: null,
        agreedArrivalDate: null,
        defaultStorageLocation: null,
        sourceOrderNumber: null,
        detailTaxRate: null,
        detailOrderNumber: null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加采购单";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
      getPurchaseOrder(id).then((response) => {
        this.form = response.data;
        this.open = true;
        this.title = "修改采购单";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updatePurchaseOrder(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addPurchaseOrder(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal
        .confirm('是否确认删除采购单编号为"' + ids + '"的数据项？')
        .then(function () {
          return delPurchaseOrder(ids);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "purchase/PurchaseOrder/export",
        {
          ...this.queryParams,
        },
        `PurchaseOrder_${new Date().getTime()}.xlsx`
      );
    },
    //部门文件导入修改打开
    daoru() {
      this.dialogVisible = true;
    },
    // 打开加载层
    openUploadLoading() {
      this.$modal.loading("正在导入，请稍候！");
    },
    //文件导入成功回传

    handlePictureSuccessPic(res, file) {
      this.$refs.daoru.clearFiles(); //去掉文件列表
      this.$modal.closeLoading();
      console.log(JSON.stringify(res));
      //设置图片访问路径 （url 后台传过来的的上传地址）
      // this.picUrl = file.response.url;
      // const url = file.response.fileName;
      this.file = file.response.url;
      console.log(JSON.stringify(this.file));
      if (res.code == 200) {
        this.dialogVisible = false;

        this.$modal.msgSuccess(res.msg);
        // if (res.msg == "操作成功") {
        //   this.$modal.msgSuccess("导入成功");
        // } else {
        //   this.$modal.msgError(res.msg);
        // }
        this.getList();
        // return true
      } else {
        this.$modal.msgError(res.msg);
        this.dialogVisible = true;
        // this.$message.msgError('该颜色未在字典定义')
        return;
      }
    },
    //图片预览
    handlePictureCardPreview(file) {
      // this.picUrl = file.url
      // this.imageUrl = file.url;
      // this.dialogVisible = true;
    },
    //图片上传前的相关判断
    beforeAvatarUpload(file) {
      // const isJPG = file.type == 'image/jpeg' || file.type == 'image/png';
      const isLt2M = file.size / 1024 / 1024 < 100;
      // if (!isJPG) {
      //     this.$message.error('上传头像图片只能是 JPG/PNG 格式!');
      // }
      if (!isLt2M) {
        this.$message.error("上传头像图片大小不能超过 100MB!");
      }
      this.openUploadLoading();
      return isLt2M;
    },

    // 文件个数超出
    handleExceed() {
      this.$modal.msgError(`上传链接文件数量不能超过 ${this.limit} 个!`);
    },
    // 上传文件让第二次覆盖第一的文件
    changeFile1(file, fileList) {
      if (fileList.length > 1) {
        this.fileLi = fileList.slice(-1);

        // this.fileList = [fileList[fileList.length - 1]]//这一步，是 展示最后一次选择文件
      }
      // this.fileSpecial = fileList;
    },
  },
};
</script>
<style lang="scss" scoped>
.el-dialog-div {
  height: 80vh;
  overflow-x: hidden;
}

.el-input.is-disabled ::v-deep .el-input__inner {
  color: #606266;
  background-color: white;
  border: none;
}

.el-textarea.is-disabled ::v-deep .el-textarea__inner {
  color: #606266;
  background-color: white;
  border: none;
  width: 500px;
  resize: none;
  cursor: pointer;
}

span.textname {
  display: -webkit-box;

  text-overflow: ellipsis;
  overflow: hidden;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  white-space: pre-wrap;
}
</style>